#include <ctime>
#include <stdio.h>
#include <stdlib.h>

#include <sys/select.h>
#include <time.h>
#include "0.sort_test.h"

#define MAX_N 10000

void selection_sort(int *arr, int l, int r){
	for(int i = l, I = r - 1; i < I; i++){
		int idx = i;
		for(int j = i + 1; j < r; j++){
			if(arr[j] < arr[idx]) idx = j;
		}
		swap(arr[i], arr[idx]);
	}
	return;
}

int main(){
	int *arr = getRandData(SMALL_DATA_N);
	TEST(selection_sort, arr, SMALL_DATA_N);
	free(arr);

	return 0;
}
